package com.ywjt.pinkelephant.dynamic.activity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.ywjt.pinkelephant.R;
import com.ywjt.pinkelephant.base.BaseActivity;
import com.ywjt.pinkelephant.dynamic.adapter.DynamicJiangAdapter;

import java.util.ArrayList;
import java.util.List;

public class ActivityJiangMore extends BaseActivity implements View.OnClickListener {
    private DynamicJiangAdapter jiangAdapter;
    private RecyclerView rcCommon;
    private List<Integer> data;


    public static void actionStart(Context context ) {
        Intent intent = new Intent(context, ActivityJiangMore.class);
        context.startActivity(intent);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){

        }
    }

    @Override
    protected void init(Bundle savedInstanceState) {
        setAndroidNativeLightStatusBar(true);
    }

    @Override
    protected int setLayoutResourceID() {
        return R.layout.activity_jiang_more;
    }

    @Override
    protected void initView() {
        setTitleText("江湖诸葛");
        rcCommon=findViewById(R.id.rcCommon);
        data=new ArrayList<>();
        data.add(1);
        data.add(1);
        data.add(1);
        data.add(1);
        jiangAdapter=new DynamicJiangAdapter(data);
        rcCommon.setLayoutManager(new LinearLayoutManager(ActivityJiangMore.this));
        rcCommon.setAdapter(jiangAdapter);
        jiangAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
            @Override
            public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
                ActivityJiangDetail.actionStart(ActivityJiangMore.this);
            }
        });
    }

    @Override
    protected void initData() { }

    /**
     * 获取要使用的标题栏样式(此函数由子类重写)
     * @return
     */
    @Override
    protected int getTitleBarType() {
        return 0;
    }

}
